//
//  ImageAndLabelCollectionViewCell.m
//  Gift
//
//  Created by dllo on 16/8/2.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ImageAndLabelCollectionViewCell.h"
#import "UIView+ChangeFrame.h"
@interface ImageAndLabelCollectionViewCell ()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *refreshLabel;
@property (nonatomic, strong) UILabel *authorLabel;
@end

@implementation ImageAndLabelCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width * 0.5, self.bounds.size.height)];
        _imageView.backgroundColor = [UIColor redColor];
        _imageView.image = [UIImage imageNamed:@"5.jpg"];
        [self.contentView addSubview:_imageView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_imageView.z_width, 10, self.bounds.size.width * 0.5, self.bounds.size.height * 0.3)];
        _titleLabel.text = @"小满生活公社";
        [self.contentView addSubview:_titleLabel];
        
        _refreshLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.z_x, _titleLabel.z_y + _titleLabel.z_height, _titleLabel.z_width, _titleLabel.z_height * 0.8)];
        _refreshLabel.text = @"更新至28期";
        [self.contentView addSubview:_refreshLabel];
        
        _authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(_refreshLabel.z_x, _refreshLabel.z_y + _refreshLabel.z_height, _refreshLabel.z_width, _refreshLabel.z_height)];
        _authorLabel.text = @"小满";
        [self.contentView addSubview:_authorLabel];
        
    }
    return self;
}
@end
